# coding: utf8
# datetime: 2021-03-16
# 题目地址: https://leetcode-cn.com/problems/squares-of-a-sorted-array/


from typing import List


class Solution:
    def sortedSquares(self, nums: List[int]) -> List[int]:
        nums = sorted(nums, key=lambda x: x if x>0 else 0-x)
        return [num*num for num in nums]


a = Solution()
print(a.sortedSquares([-7,-3,2,3,11]))